package com.ftx.common.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;

import javax.annotation.Resource;

/**
 * Created by fengtingxin on 2019/5/31.
 * redis工具类  java中写死url和port的方式，已经尝试过通过spring加载，目前暂未实现
 */
public class RedisUtils {

    private final static Logger logger = LoggerFactory.getLogger(RedisUtils.class);

    @Resource
    private Jedis redis;

    public void set(String key,String value){
        redis.set(key,value);
    }

    public String get(String key){
        return redis.get(key);
    }

    public void test(){
        
    }

    public Long lPush(String key,String value){
        return redis.lpush(key,value);
    }

    public String lpop(String key){
        return redis.lpop(key);
    }

    public Long zAdd(String key,double score,String member){
        return redis.zadd(key,score,member);
    }

}
